/*
 * Copyright (C), 2015-2019
 * FileName: JThread
 * Author:   lizhao
 * Date:     2019-02-12 17:13
 * Description: 用来表示线程对象
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.lizhaoblog.jjvm.runtime;

/**
 * 〈一句话功能简述〉<br>
 * 〈用来表示线程对象〉
 *
 * @author lizhao
 * @date 2019-02-12 17:13
 * @since 1.0.0
 */
public class JThread {
    int pc;
    JStack stack;

    public JThread() {
        stack = new JStack(1024);
    }

    public int getPc() {
        return pc;
    }

    public void setPc(int pc) {
        this.pc = pc;
    }

    public void pushFrame(Frame frame) {
        stack.push(frame);
    }

    public Frame popFrame() {
        return stack.pop();
    }

    public Frame currentFrame() {
        return stack.top();
    }
}
